<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>互联网村镇管理平台</title>
    <link rel="stylesheet" type="text/css" th:href="@{/css/common.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/css/main.css}" />
</head>
<body>

    <div class="container clearfix">

        <!--/sidebar-->
        <div class="main-wrap">
            <div class="crumb-wrap">
                <div class="crumb-list">
                    <i class="icon-font">&#xe923;</i>
                    <a href="javascript:void(0);" th:if="${status==2}">信息发布</a>
                    <a href="javascript:void(0);" th:if="${status==1}">信息审核</a>
                    <span class="crumb-step">&gt;</span>
                    <span class="crumb-name">餐饮饭店</span>
                </div>
            </div>
            <div class="search-wrap">
                <div class="search-content">
                    <form th:action="@{/restaurant/list}" method="post" id="queryForm">
                        <table class="search-tab" style="margin-left: 10px;">
                            <tr>
                                <th width="70">饭店名称:</th>
                                <td>
                                    <input class="common-text" placeholder="饭店名称" name="restaurantName" th:value="${restaurantName }" type="text" />
                                </td>
                                <td>
                                    <input class="btn btn-primary btn2" name="sub" value="查询" type="submit">
                                </td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
            <div class="result-wrap">
                <div class="result-title" th:if="${status==2}">
                    <div class="result-list">
                        <a th:href="@{/restaurant/gotoAddPage}" href=""><i class="icon-font">&#xea0a;</i>新增饭店</a>
                        <a id="batchDel" href="javascript:batchDeleteRestaurant();"><i class="icon-font">&#xe9ac;</i>批量删除</a>
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th class="tc" width="5%"><input class="allChoose" onclick="javascript:shiro.form.setCheckBoxSelectToggle('restaurantIdCheckBox');" type="checkbox" /></th>
                            <th width="20%">饭店名称</th>
                            <th width="20%">饭店描述</th>
                            <th width="20%">饭店地址</th>
                            <th width="15%">发布时间</th>
                            <th class="tc" width="10%">操作</th>
                        </tr>
                        <tr th:each="restaurant:${restaurantList}">
                            <td class="tc">
                                <input name="restaurantIdCheckBox" th:value="${restaurant?.restaurantId }" type="checkbox" />
                            </td>
                            <td th:text="${restaurant?.restaurantName }"></td>
                            <td th:text="${restaurant?.content }"></td>
                            <td th:text="${restaurant?.address }"></td>
                            <td th:text="${#dates.format(restaurant?.createTime,'yyyy-MM-dd HH:mm:ss')}"></td>
                            <td class="tc" th:if="${restaurant?.status==2}">
                                <a class="link-update" th:href="@{'/restaurant/gotoEditPage/' + ${restaurant?.restaurantId}}">修改</a>
                                <a class="link-del" th:href="'javascript:deleteRestaurant(\'' + ${restaurant?.restaurantId } + '\',\'' + ${restaurant?.status } + '\');'">删除</a>
                            </td>
                            <td class="tc" th:if="${restaurant?.status==1}">
                                <a class="link-tongguo" th:href="'javascript:adoptRestaurant(\'' + ${restaurant?.restaurantId } + '\');'">通过</a>
                                <a class="link-bohui" th:href="'javascript:rejectRestaurant(\'' + ${restaurant?.restaurantId } + '\');'">驳回</a>
                            </td>
                            <td class="tc" th:if="${restaurant?.status==3}">
                                <a class="link-tongguo" th:href="'javascript:viewRestaurant(\'' + ${restaurant?.restaurantId } + '\');'">查看</a>
                                <a class="link-bohui" th:href="'javascript:deleteRestaurant(\'' + ${restaurant?.restaurantId } + '\',\'' + ${restaurant?.status } + '\');'">删除</a>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="list-page" th:utext="${pageHtml}">
                </div>
            </div>
        </div>
    </div>
    <div th:include="admin/common/common"></div>
    <script type="text/javascript" th:src="@{/js/web/restaurant/restaurant.js?v=1.0}"></script>
</body>
</html>